home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 818 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. From: bs@research.att.com
  2. Message-ID: <199603212110.OAA20209@ncar.ucar.EDU>
  3. X-Original-Date: Thu, 21 Mar 96 15:31 EST
  4. Path: in2.uu.net!bounce-back
  5. Date: 22 Mar 96 02:22:53 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Organization: -
  8. Newsgroups: comp.std.c++
  9. Subject: Re: Exception handling -- was a finally block ever considered?
  10. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  11.     iQBFAgUBMVIPGOEDnX0m9pzZAQGHVgF/XnZAQUNbn0W+0U9AXCWvLko8cuGNN1cf
  12.     KdFyasw+d7PWDokv/LqPqiyJYjhp34Vq
  13.     =DXI8
  14.  
  15. From: Fredrik Jonsson <euafjo@uab.ericsson.se> writes:
  16.  
  17.  > Jason D. Morris wrote:
  18.  > > 
  19.  > > Ok, but that still doesn't answer my question.  I didn't ask for a
  20.  > > method for simulating a finally block, I asked if the committee had
  21.  > > considered a finally block as part of the exception handling
  22.  > > mechanism, and if they had, why it wasn't adopted.
  23.  > > 
  24.  > > Jason
  25.  > 
  26.  > I know the finally statement was mentioned/discussed during
  27.  > afterwork hours at the Santa Cruz meeting but unfortunately
  28.  > that is about it. (I agree with you that it is very convenient
  29.  > to have the finally block, and most Borland Delphi or Java
  30.  > programmers will agree on that.)
  31.  > 
  32.  > Ie. the answer to your question would be no, it has not been
  33.  > discussed, at least not as far as I know.
  34.  
  35. A finally-clause on a try block was certainly considered during the
  36. design of the exception handling mechanisms. I considered it ad hoc
  37. and inelegant compared to the "resource requisition is initialization"
  38. technique. Also, catch(...) has some of the properties (good and bad)
  39. of a finally-clause. See for example sec 16.5 of D&E.
  40.  
  41.     - Bjarne
  42.  
  43. ---
  44. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  45. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  46. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  47. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  48. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  49.